<?php /* Smarty version 2.6.25, created on 2014-01-03 14:08:31
         compiled from exercise/views/admin.new-folder.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'count', 'exercise/views/admin.new-folder.tpl', 113, false),)), $this); ?>
<script type="text/javascript" src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/ckeditor/ckeditor.js"></script> 
<script type="text/javascript" src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/ckfinder/ckfinder.js"></script>  
<link href="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/jquery-ui/css/ui-lightness/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/jquery-ui/js/jquery-ui.js"></script>
<script src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/jquery.slug.js"></script>

<script type="text/javascript">
    //<![CDATA[

    jQuery(document).ready(function (){
        CKFinder.setupCKEditor( null, '<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/ckfinder/' );
        jQuery( "#images" ).sortable();
        jQuery( "#images" ).disableSelection();
        //Datepicker
        jQuery( ".date" ).datepicker({
            showAnim        : 'slideDown',
            showButtonPanel : true,
            dateFormat      : '<?php echo $this->_tpl_vars['datepickerFormat']['js']; ?>
'
        });
        var imgId;
        //Display images
        jQuery(".input_image[value!='']").parent().find('div').each( function (index, element){
            jQuery(this).toggle();
        });
        //Make slug
        <?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langDiv'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langDiv']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['item']):
        $this->_foreach['langDiv']['iteration']++;
?>
        jQuery('#title<?php echo $this->_foreach['langDiv']['iteration']; ?>
').makeSlug({
            slug: jQuery('#alias<?php echo $this->_foreach['langDiv']['iteration']; ?>
')
        });
        <?php endforeach; endif; unset($_from); ?>

        <?php if ($this->_tpl_vars['lid']): ?>
        //Display tabs
        jQuery("ul.content-box-tabs  a").removeClass('current');
        jQuery("#tab_a<?php echo $this->_tpl_vars['lid']; ?>
").addClass('current');
        
        jQuery("div.tab-content").addClass('hidden');
        jQuery("#tab<?php echo $this->_tpl_vars['lid']; ?>
").removeClass('hidden');
        <?php endif; ?>
            
    });

    function BrowseServer(id)
    {
    	imgId = id;
    	// You can use the "CKFinder" class to render CKFinder in a page:
    	var finder = new CKFinder();
    	finder.basePath = '<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/js/ckfinder/';	// The path for the installation of CKFinder (default = "/ckfinder/").
    	finder.selectActionFunction = SetFileField;
    	finder.popup();

    	// It can also be done in a single line, calling the "static"
    	// Popup( basePath, width, height, selectFunction ) function:
    	// CKFinder.Popup( '../../', null, null, SetFileField ) ;
    	//
    	// The "Popup" function can also accept an object as the only argument.
    	// CKFinder.Popup( { BasePath : '../../', selectActionFunction : SetFileField } ) ;
    }

    // This is a sample function which is called when a file is selected in CKFinder.
    function SetFileField( fileUrl )
    {
    	//document.getElementById( 'xFilePath' ).value = fileUrl;
    //	document.getElementById( 'chooseImage_img' + imgId ).src = fileUrl;
        document.getElementById( 'xFilePath' + imgId).value = fileUrl;
      //  document.getElementById( 'chooseImage_div' + imgId).style.display = '';
       // document.getElementById( 'chooseImage_noImage_div' + imgId ).style.display = 'none';
        
    }
    function clearImage(imgId)
    {
        document.getElementById( 'xFilePath' + imgId).value = '';
    }

    function addMoreFile()
    {
        jQuery("ul#files > li.hidden").filter(":first").removeClass('hidden');
    }
    
</script>
<style type="text/css">
    #files { list-style-type: none; margin: 0; padding: 0;}
   #files li { margin: 10px; float: left; text-align: center;  height: 20px;}
</style>


       
            <div class="content-box"><!-- Start Content Box -->
                
                <div class="content-box-header">
                    
                    <h3>Edit Demo</h3>
                    
                    <ul class="content-box-tabs">
                        <?php if ($this->_tpl_vars['fullPermisison']): ?><li><a href="#tab0" class="default-tab">General</a></li><?php endif; ?>
                        <?php $_from = $this->_tpl_vars['allLangs']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['langTab'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['langTab']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['item']):
        $this->_foreach['langTab']['iteration']++;
?>
                        <li><a <?php if (! $this->_tpl_vars['fullPermisison'] && ($this->_foreach['langTab']['iteration'] <= 1)): ?>class="default-tab"<?php endif; ?> href="#tab<?php echo $this->_tpl_vars['item']['lang_id']; ?>
" style="padding-bottom: 4px;"><image style="vertical-align:middle;" src="<?php echo $this->_tpl_vars['BASE_URL']; ?>
<?php echo $this->_tpl_vars['item']['lang_image']; ?>
"> <?php echo $this->_tpl_vars['item']['name']; ?>
</a></li>
                        <?php endforeach; endif; unset($_from); ?>
                    </ul>
                    
                    <div class="clear"></div>
                    
                </div> <!-- End .content-box-header -->
                
                <div class="content-box-content">
                
                    <form action="" method="post">
                    
                    <!-- GENERAL -->
                    <div class="tab-content  id="tab0">
                    
                        <!-- ERROR -->
                        <?php if (count($this->_tpl_vars['errors']) > 0): ?>
                        <div class="notification error png_bg">
                            <a href="#" class="close"><img src="<?php echo $this->_tpl_vars['LAYOUT_HELPER_URL']; ?>
admin/images/icons/cross_grey_small.png" title="Close this notification" alt="close" /></a>
                            <div>
                                <?php if ($this->_tpl_vars['errors']['main']): ?>
                                    Error: <?php echo $this->_tpl_vars['errors']['main']; ?>

                                <?php else: ?>
                                    Error: Please check following information again
                                <?php endif; ?> 
                                                                       
                            </div>
                        </div>
                        <?php endif; ?>
                            
                            <fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
                                
                                
                                <p>
                                        <label>Title</label>
                                        <input class="text-input large-input" type="text"  name="data[title]" value="<?php echo $this->_tpl_vars['data']['title']; ?>
" />
                                    </p>
                                <p>
                                
                                 <p>
                                    <label>Description</label>
									<textarea class="text-input textarea" id="textarea" name="data[description]" cols="79" rows="5"><?php echo $this->_tpl_vars['data']['description']; ?>
</textarea>
                                        
                                </p>
                                <p>
                                    <label>Subject<span class="red">*</span></label>              
                                    <select name="data[subject_id]" class="small-input" style="width:376px">
                                    <?php $_from = $this->_tpl_vars['allCats']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['item']):
?>
                                        <option value="<?php echo $this->_tpl_vars['item']['content_category_gid']; ?>
" <?php if ($this->_tpl_vars['data']['subject_id'] == $this->_tpl_vars['item']['content_category_gid']): ?>selected="selected"<?php endif; ?>><?php echo $this->_tpl_vars['item']['name']; ?>
</option>
                                    <?php endforeach; endif; unset($_from); ?>
                                    </select> 
                                </p>
                               
                               
                                          
                              
                                
         <!-- file -->   
                                    
                                <h4>File: </h4>  
                              
                                
         <!-- END file -->    


                                
                                <p><a href="javascript:addMoreFile()">+ Add more files</a></p> 
                                <ul id="files">
                                    <?php unset($this->_sections['images']);
$this->_sections['images']['name'] = 'images';
$this->_sections['images']['loop'] = is_array($_loop=50) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['images']['show'] = true;
$this->_sections['images']['max'] = $this->_sections['images']['loop'];
$this->_sections['images']['step'] = 1;
$this->_sections['images']['start'] = $this->_sections['images']['step'] > 0 ? 0 : $this->_sections['images']['loop']-1;
if ($this->_sections['images']['show']) {
    $this->_sections['images']['total'] = $this->_sections['images']['loop'];
    if ($this->_sections['images']['total'] == 0)
        $this->_sections['images']['show'] = false;
} else
    $this->_sections['images']['total'] = 0;
if ($this->_sections['images']['show']):

            for ($this->_sections['images']['index'] = $this->_sections['images']['start'], $this->_sections['images']['iteration'] = 1;
                 $this->_sections['images']['iteration'] <= $this->_sections['images']['total'];
                 $this->_sections['images']['index'] += $this->_sections['images']['step'], $this->_sections['images']['iteration']++):
$this->_sections['images']['rownum'] = $this->_sections['images']['iteration'];
$this->_sections['images']['index_prev'] = $this->_sections['images']['index'] - $this->_sections['images']['step'];
$this->_sections['images']['index_next'] = $this->_sections['images']['index'] + $this->_sections['images']['step'];
$this->_sections['images']['first']      = ($this->_sections['images']['iteration'] == 1);
$this->_sections['images']['last']       = ($this->_sections['images']['iteration'] == $this->_sections['images']['total']);
?> 
                                        <?php $this->assign('i', $this->_sections['images']['iteration']); ?> 
                                     <li <?php if ($this->_tpl_vars['i'] > 2 && $this->_tpl_vars['i'] > count($this->_tpl_vars['data']['images'])): ?>class="hidden"<?php endif; ?>>   
                                            <input class="text-input" id="xFilePath<?php echo $this->_tpl_vars['i']; ?>
" name="data[file][]" type="text" size="60" />
												<input type="button" class="button" onclick="BrowseServer(<?php echo $this->_tpl_vars['i']; ?>
);" value="Browse Server" />
												<a href="javascript:clearImage(<?php echo $this->_tpl_vars['i']; ?>
);">Delete</a>
                                    </li>
                                    <?php endfor; endif; ?>
                                </ul>
								
                                
                                <br style="clear: both;"/>
                                
                                
                                <br/>
                                    <input class="button submit" type="button" value="Save" />
                                </p>
                                
                            </fieldset>
                            
                            
                            <div class="clear"></div><!-- End .clear -->
                            
                    </div>  <!-- End GENERAL --> 
                    
                    
                   
                                
                        
                   
                    
                  </form>
                  
                </div> <!-- End .content-box-content -->
                
            </div> <!-- End .content-box -->
            
            
            <div class="clear"></div>
